home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Sample Code / Snippets / Development Tools & Languages / Shared Lib. Mgr. C++ / Makefile < prev   
Encoding:
Makefile  |  1992-08-30  |  6.1 KB  |  189 lines  |  [TEXT/MPS ]

  1. # Makefile for the TProcess SLM Library function
  2. # Kent Sandvik, Apple DTS Monday, August 10, 1992 1:19:37
  3. # Copyright Apple Computer, Inc 1992. All rights reserved.
  4.  
  5. # We will have three folders, Sources, Objects and Built. If
  6. # these folder are missing, please create them:
  7.  
  8. #    newfolder Objects; newfolder Sources; newfolder Built;
  9.  
  10.  
  11. # DEFAULT TOOL DEFINITIONS ----------------------------------------------#
  12. # List all the flags and file/folder path definitions here:
  13. CPlus        = CPlus
  14. StdAIncludes = -i "{AIncludes}" -i "{CIncludes}:"
  15. StdCIncludes = -i "{CIncludes}" -i "{CIncludes}:"
  16. StdPIncludes = 
  17. StdCPIncludes = -i "{CIncludes}" -i "{CIncludes}:"
  18. StdADump     = 
  19. StdCDump     = 
  20. StdPDump     = 
  21. StdCPDump    =  
  22. LIB          = Lib {SymbolOption}
  23. LINK         = Link {SymbolOption} -model far
  24. COUNT        = Count
  25. COUNTOPTS    = 
  26. CTAGS        = Ctags
  27. CTAGSOPTS    = -p -local -update
  28. DELETE       = Delete
  29. DELETEOPTS   = -i
  30. FILES        = Files
  31. FILESOPTS    = -l
  32. LIBOPTS      = 
  33. LINKOPTS     = 
  34. MAKEFILE     = Makefile
  35. PRINT        = Print
  36. PRINTOPTS    = 
  37. REZ          = Rez
  38. SETFILE      = SetFile
  39. SETFILEOPTS  = -t 'MPST' -c 'MPS '
  40.  
  41.  
  42. # COMPILER OPTIONS -- for SLM/DLL use -----------------------------------#
  43. # List all the additional flags for compilers for SLM use here:
  44.  
  45. AOptions = {SymbolOption} {ModelOption} {MyPreAOptions} -model far -case on {MyAOptions}
  46. COptions = {SymbolOption} {ModelOption} {MyPreCOptions} -model far -mf -b2 -w2 -opt full {MyCOptions}
  47. ROptions = {SymbolOption} {ModelOption} {MyPreROptions}  {MyROptions}
  48. CPOptions = {SymbolOption} {ModelOption} {MyPreCPlusOptions} -model far -mf -b2 -opt full -w1 -z15 -z17 {MyCPlusOptions}
  49.  
  50.  
  51. # PATH DEFINITIONS ------------------------------------------------------#
  52. # List all the path definitions four our source, library and object files:
  53.  
  54. SOURCES            = :Sources:
  55. OBJECTS            = :Objects:
  56. BUILT            = :Built:
  57. SLMLIBRARIES    = {Libraries}
  58.  
  59.  
  60.  
  61. # DEFAULT C++ BUILD RULE ------------------------------------------------#
  62. # Define here the default rule for building C++ source files:
  63. .cp.o    ƒ    .cp
  64.     IF {Progress}; Echo "∂t∂tCompiling {Default}.cp"; END
  65.         CPlus {DepDir}{Default}.cp -o {Targ} {StdCPDump} {CPOptions} {StdCPIncludes}
  66.  
  67.  
  68. # TARGETS -- the files we need for building the shared library ----------#
  69. # Define here all the files that are dependent on the final shared library:
  70.  
  71. TARGETS =        "{OBJECTS}ProcessNV.RSRC" ∂
  72.                 "{OBJECTS}Process.RSRC" ∂
  73.                 "{BUILT}ProcessLibrary" ∂
  74.                 "{OBJECTS}TestTool.RSRC" ∂
  75.                 "{BUILT}TestTool"
  76.             
  77.  
  78. # DEPENDENCY LISTS -- various SLM sub-parts -----------------------------#
  79. # Define here various parts of the SLM, the dependencies they have:
  80. # Library.RSRC dependencies
  81. LIBRARY_RSRC =     "{OBJECTS}ProcessNV.cp.o" ∂
  82.                 "{OBJECTS}Process.cp.o"
  83.                 
  84.  
  85. # TestTool.RSRC dependencies
  86. TESTTOOL_RSRC = "{OBJECTS}TestTool.cp.o"
  87.  
  88.  
  89. # Library general object files needed for the final link
  90. LIBRARY_OBJS =    "{SLMLIBRARIES}LibraryManager.o" "{Libraries}Runtime.o" ∂
  91.                 "{Libraries}Interface.o" "{CLibraries}StdCLib.o" ∂
  92.                 "{CLibraries}CPlusLib.o"
  93.  
  94.  
  95. # Tool general object files needed for the finla link
  96. TOOL_OBJS =     "{OBJECTS}ProcessNV.cl.o" "{CLibraries}CPlusLib.o" ∂
  97.                 "{Libraries}ToolLibs.o" "{SLMLIBRARIES}LibraryManager.o" ∂
  98.                 "{Libraries}Runtime.o" "{Libraries}Interface.o" ∂
  99.                 "{CLibraries}StdCLib.o"
  100.  
  101.                 
  102. # Res files (.r) needed for building Library
  103. LIBRARY_R =        "{SOURCES}Process.r"
  104.  
  105.  
  106. # Res files (.r) needed for building test tool
  107. TOOL_R =        "{SOURCES}TestTool.r"
  108.  
  109.  
  110. # NV .cp file dependency for .RSRC files
  111. LIB_NVSRC    =    "{SOURCES}ProcessNV.cp"
  112.  
  113.  
  114. # DEFAULT BUILD RULE ----------------------------------------------------#
  115. # Define here the default build rule for objects and all files:
  116.  
  117. "{Objects}"    ƒ "{Sources}"
  118.  
  119. all            ƒ     {TARGETS}
  120.  
  121.  
  122. # FILE DEPENDENCIES -----------------------------------------------------#
  123. # Define here all the known file dependencies with all SLM build files:
  124.  
  125. # LibraryNV.RSRC file
  126. "{OBJECTS}ProcessNV.RSRC"    ƒ    {LIB_NVSRC}
  127.  
  128.  
  129. # Library.RSRC file
  130. "{OBJECTS}Process.RSRC"        ƒƒ    {LIBRARY_RSRC} {LIBRARY_OBJS}
  131.     IF {Progress}; Echo "∂t∂tLinking {Targ}"; END
  132.     {LINK} -w -d -t exmp -c RSED         -sg "ProcessLibrary"="Main","STDCLIB","SANELIB"∂
  133.     ,"INTENV","SADEV","STDIO" -sg %A5Init=A5Init -m "DynamicCodeEntry" -o {Targ} ∂
  134.         {LIBRARY_RSRC} {LIBRARY_OBJS}
  135.  
  136.  
  137. # The Shared Library itself
  138. "{BUILT}ProcessLibrary"    ƒƒ {LIBRARY_R} ∂
  139.         "{RIncludes}SLMVersionResource.r" ∂
  140.         "{RIncludes}SysTypes.r" "{OBJECTS}ProcessNV.RSRC" ∂
  141.         "{OBJECTS}Process.RSRC"
  142.     If {Progress}; Echo "∂t∂tRezzing {Targ}"; End
  143.     {REZ} -t libr -c OMGR -s "{OBJECTS}" ∂
  144.         -i "{RIncludes}:" -i "{RIncludes}" ∂
  145.         -i "{OBJECTS}" -o {Targ} {LIBRARY_R}
  146.  
  147. "{Built}ProcessLibrary"    ƒƒ {LIBRARY_R} ∂
  148.         "{RIncludes}SLMVersionResource.r" ∂
  149.         "{RIncludes}SysTypes.r" "{OBJECTS}ProcessNV.RSRC" ∂
  150.         "{OBJECTS}Process.RSRC"
  151.     {SETFILE} -a ib {Targ}
  152.  
  153.  
  154. # TestTool
  155. "{OBJECTS}TestTool.RSRC"    ƒƒ {TESTTOOL_RSRC} {TOOL_OBJS}
  156.     If {Progress}; Echo "∂t∂tLinking {Targ}"; End
  157.     {LINK} -w -d -t exmp -c RSED -sn STDIO=Main -sn INTENV=Main -sn %A5Init=Main -o {Targ} ∂
  158.         {TESTTOOL_RSRC} {TOOL_OBJS}
  159.  
  160. "{BUILT}TestTool"    ƒƒ {TOOL_R} ∂
  161.         "{RIncludes}SLMVersionResource.r" ∂
  162.         "{RIncludes}SysTypes.r" "{OBJECTS}TestTool.RSRC"
  163.     If {Progress}; Echo "∂t∂tRezzing {Targ}"; End
  164.     {REZ} -t MPST -c "MPS " -s "{OBJECTS}" ∂
  165.         -i "{RIncludes}:" -i "{RIncludes}" ∂
  166.         -i "{OBJECTS}" -o {Targ} {TOOL_R}
  167.         
  168.  
  169. # SPECIAL COMPILE STATEMENTS -------------------------------------------#
  170. # Define here any special compile statements needed to build various
  171. # shared library parts (like the special CPlusPC tool):
  172.  
  173. # LibraryNV.cp.o file
  174. "{OBJECTS}ProcessNV.cp.o" ƒ  "{SOURCES}ProcessNV.cp" ∂
  175.         "{Sources}Process.h" ∂
  176.         "{CIncludes}LibraryManagerClasses.h" ∂
  177.         "{CIncludes}LibraryManager.h" ∂
  178.         "{CIncludes}LibraryManagerUtilities.h"
  179.     If {Progress}; Echo "∂t∂tCompiling ProcessNV.cp"; End
  180.         CPlusPC -resfile "{OBJECTS}ProcessNV.RSRC" -resid 0 -client "{OBJECTS}ProcessNV.cl.o" ∂
  181.         -libname slm:dtsl -restype code {CPOptions} "{SOURCES}ProcessNV.cp"  ∂
  182.             {StdCPDump} {StdCPIncludes} -o {Targ}
  183.  
  184.  
  185. # LibraryNV.cl.o file
  186. "{Objects}ProcessNV.cl.o"    ƒ    "{OBJECTS}ProcessNV.cp.o"
  187.         SetFile -m . "{OBJECTS}ProcessNV.cl.o"
  188.  
  189. # THE END -------------------------------------------------------------#